class Person {
    private String _name;
    private String _gender;
    private int _age;

    public Person(String name, String gender, int age) {
        _name = name;
        _gender = gender;
        _age = age;
    }


    public String toString() {
        return "姓名: " + _name + ", 性别: " + _gender + ", 年龄: " + _age;
    }
}

class Teacher extends Person {
    private String _title;
    private String _department;

    public Teacher(String name, String gender, int age, String title, String department) {
        super(name, gender, age);
        _title = title;
        _department = department;
    }

    public String toString() {
        return super.toString() + ", 职称: " + _title + ", 部门: " + _department;
    }
}

class Student extends Person {
    private String _id;
    private String _className;

    public Student(String name, String gender, int age, String id, String className) {
        super(name, gender, age);
        _id = id;
        _className = className;
    }

    public String toString() {
        return super.toString() + ", 学号: " + _id + ", 班级: " + _className;
    }
}



public class test3 {
    public static void main(String[] args) {

        Teacher teacher = new Teacher("张三", "男", 35, "老师", "数学系");
        Student student = new Student("李四", "女", 20, "202301", "数学系");

        System.out.println(teacher);
        System.out.println(student);

    }
}
